package com.five.util;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author: 王登峰
 * @Description:
 * @Date: 2020/11/16 10:29
 */
public class PrintJsonData {
    public static void printData(Object obj, HttpServletResponse response){
        String s = JSON.toJSONStringWithDateFormat(obj,"yyyy-MM-dd");
        PrintWriter out = null;
        try {
            out = response.getWriter();
        } catch (IOException e) {
            e.printStackTrace();
        }
        out.print(s);
        out.flush();
        out.close();
    }
}
